<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type"
	content="application/vnd.wap.xhtml+xml;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link type="text/css" rel="stylesheet" href="model.css"></link>
<script type="text/javascript" src="jquery-1.4.4.min.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		refresh();
	});

	function refresh() {
		var title = window.article.getTitle();
		var body = window.article.getBody();
		alert(title);
		$("#title").append(title);
		$("#body").append(body);
	}

	function getSize(className) {
		if (className === "") {
			return 0;
		} else if (className.substring(0, 4) === "plus") {
			return parseInt(className.substring(4), 10);
		} else {
			return 0 - parseInt(className.substring(5), 10);
		}
	}

	function makeClass(size) {

		if (size == 0) {
			return "";
		} else if (size > 0) {
			return "plus" + size;
		} else {
			return "minus" + (0 - size);
		}
	}

	function decreaseSize() {
		var body = document.getElementsByTagName("body")[0];
		var size = getSize(body.className) - 1;
		if (size >= -1) {
			body.setAttribute("class", makeClass(size));
		}
		return false;
	}

	function increaseSize() {
		var body = document.getElementsByTagName("body")[0];
		var size = getSize(body.className) + 1;
		if (size <= 5) {
			body.setAttribute("class", makeClass(size));
		}
		return false;
	}
</script>
<title></title>
</head>
<body>
	<div id="main">
		<div id="loading"></div>
		<h1 id="title"></h1>
		<p id="body">
		test</p>
	</div>
</body>
</html>
